#!/bin/sh
## random a lock image from given path, generate ~/.i3lock.png   

if [ -z "$1" ]; then echo "please given a path" && exit 1; fi

IMAGE=$(feh -rz -L %f $1 |  shuf -n1)

# fill mode with blur
convert ${IMAGE} -resize "1920x1080"^ -gravity center -crop 1920x1080+0+0 +repage -blur 0x16 ~/.i3lock.png
# 使用当前屏幕模糊化图片进行锁屏
#i3lock  -i ~/.i3lock.png
# 锁屏 添加时间
i3lock  -k -i ~/.i3lock.png
# 锁屏 添加时间+不用验证
#i3lock  -k --no-verify -i ~/.i3lock.png

